#include<iostream>
#include<assert.h>
using namespace std;
class Date
{
public:
	bool CheckInvalid() const; 						// 判断是否为无效日期
	Date(int year = 1, int month = 1, int day = 1); // 构造函数
	Date(const Date& d);							// 拷贝构造函数
	bool operator<(const Date& d) const;
	bool operator==(const Date& d) const;
	bool operator<=(const Date& d) const;
	bool operator>=(const Date& d) const;
	bool operator>(const Date& d) const;
	bool operator!=(const Date& d) const;

	// d1 += 100
	Date& operator+=(int day);
	Date operator+(int day);
	int GetMonthDay(int year, int month)
	{
		assert(month > 0 && month < 13);
		static int MonthDay[13] = { 0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31 };
		// 闰年 2月有29天
		if (month == 2 && ((year % 4 == 0 && year % 100 != 0) || (year % 400 == 0)))
		{
			return 29;
		}
		return MonthDay[month];
	}
	void Print()
	{
		cout << _year << "-" << _month << "-" << _day << endl;
	}
private:
	int _year;
	int _month;
	int _day;
};